local paoxiao = fk.CreateSkill{
    name = "ym_water__paoxiao",
}
Fk:loadTranslationTable{
    ["ym_water__paoxiao"] = "咆哮",
    [":ym_water__paoxiao"] = "你获得或失去过【杀】的阶段结束时，你可以执行之。",
    ["#ym_water__paoxiao"] = "是否发动 咆哮，执行一个%arg",
    
    ["$ym_water__paoxiao1"] = "万钧勇力，斩将拔旗！",
    ["$ym_water__paoxiao2"] = "虎牢硝烟起，长坂水逆流！",
}

paoxiao:addEffect(fk.EventPhaseEnd,{
    can_trigger = function (self, event, target, player, data)
        if player:hasSkill(paoxiao.name) then
            local room = player.room
            if #room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function(e)
            for _, move in ipairs(e.data) do
                if move.from == player then
                    for _, info in ipairs(move.moveInfo) do
                        if info.fromArea == Card.PlayerHand and Fk:getCardById(info.cardId).trueName == "slash" then
                            return true
                        end
                    end
                end
                if move.to == player and move.toArea == Card.PlayerHand then
                    for _, info in ipairs(move.moveInfo) do
                        if Fk:getCardById(info.cardId).trueName == "slash" then
                            return true
                        end
                    end
                end
            end
            end, Player.HistoryPhase) == 0 then return false end
            return room.current and (room.current.phase > 1 and room.current.phase < 8)
        end
    end,
    on_cost = function (self, event, target, player, data)
        if player.room:askToSkillInvoke(player,{
            skill_name = paoxiao.name,
            prompt = "#ym_water__paoxiao:::"..Util.PhaseStrMapper(player.room.current.phase)
        }) then
            return true
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        player:gainAnExtraPhase(room.current.phase, paoxiao.name)
    end,
})

return paoxiao